package com.itheima.day06.demo7;

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Demo7 {
    public static void main(String[] args) {
        Set<User> users = new HashSet<User>();
        users.add(new User("zs","123456"));
        Scanner scanner = new Scanner(System.in);

        while (true) {
            System.out.println("请输入账户:");
            String username = scanner.next();
            System.out.println("请输入密码:");
            String password = scanner.next();
            User user = new User(username, password);
            if (users.add(user)) {
                System.out.println("注册成功");
            }else {
                System.out.println("注册失败");
            }
        }

    }
}
